package com.zh.controller;


import com.zh.entry.Airports;
import com.zh.entry.Flights;
import com.zh.entry.Flights_tickets;
import com.zh.pojo.FlysPojo;
import com.zh.service.FlysService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
@RequestMapping("/flys/")
public class FlyController {

    @Autowired
    private FlysService flysService;


    @RequestMapping("findall")
    public ArrayList<FlysPojo> findall(FlysPojo flysPojo) {
        ArrayList<FlysPojo> findflys = flysService.findflys(flysPojo);
        return findflys;
    }

    @RequestMapping("findbug")
    public ArrayList<Flights_tickets> findbuy(Flights flights) {
        System.out.println(flights);
        System.out.println(flysService.findByFilghtsid(flights));
        return flysService.findByFilghtsid(flights);
    }
}
